﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace weighing
{
    public class Constant
    {
        /// <summary>
        /// local image file not exist tag
        /// </summary>
        public static readonly string ImageFileNotExistTag = "@notExist";

        public static readonly string OfficalCompany = "云南奔牛衡器";
        /// <summary>
        ///IC卡 数据长度不到16位时 特别的结尾点位字符
        /// </summary>
        public static readonly char SpecialChar = '@';
        public static string TempPath = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "temp");
        /// <summary>
        /// 默认的截图保存位置
        /// </summary>
        public static string DefaultImagePath = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "imgs");
        public static string HUserFilePath = TempPath + "\\" + "user.xml";
        public static string tempPath = MyHelper.FileHelper.GetRunTimeRootPath() + "temp";
        public static string EXCLBillPath = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "bill");

        public static string BackupFieldItemSourcefile = "backup_field_items.json";
        /// <summary>
        /// 锁定数据文件
        /// </summary>
        public static string LockDataFile = MyHelper.FileHelper.GetRunTimeRootPath() + "temp\\lockData.xml";
        public static string dbPath = MyHelper.FileHelper.GetRunTimeRootPath() + "db";
        public static string initSqlFile = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "db", "init.sql");
        /// <summary>
        /// SQLite默认的数据存放路径
        /// </summary>
        public static string dataPath = MyHelper.FileHelper.GetRunTimeRootPath() + "data";

        /// <summary>
        /// Token file默认的数据存放路径
        /// </summary>
        public static string TokenFile = System.IO.Path.Combine(dataPath, "token.json");
        /// <summary>
        /// SQLite默认的数据存名称
        /// </summary>
        public static string dataName = "data.db";
        /// <summary>
        /// SQLite默认的数据存密码
        /// </summary>
        public static string defauleSqlitePassword = "rykj.code";
       
        public static string CaputureSuffix = ".jpg";
        public static string BillCaputureSuffix = "_p.jpg";
        /// <summary>
        /// yyyy-MM-dd
        /// </summary>
        public static string DateFormat = "yyyy-MM-dd";

        /// <summary>
        ///HH:mm:ss
        /// </summary>
        public static string TimeFormat = "HH:mm:ss";
        /// <summary>
        /// yyyy-MM-dd HH:mm:ss 24hours
        /// </summary>
        public static string DateTimeFormat = "yyyy-MM-dd HH:mm:ss";

        /// <summary>
        /// yyyyMMdd
        /// </summary>
        public static string DateNumberFormat = "yyyyMMdd";

        /// <summary>
        /// 图片压缩的限止大小 ,大于5M需要压缩
        /// </summary>
        public static long ImageCompresLength = 5 * 1000 * 1024;

        public static string ActiveCodePath = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "code");
        /// <summary>
        /// 激活密文 文件保存的路径
        /// </summary>
        public static string ActiveCodeEncryptFile = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "code", "encrypt.ini");

        /// <summary>
        /// 激活码明文文件
        /// </summary>
        public static string ActiveCodeFile = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "激活码.txt");

        /// <summary>
        /// custom icon file 
        /// </summary>
        public static string CustomIconFile = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "favicon.ico");
        //默认的受限次数   
        public static int Limits = 200;
        /// <summary>
        /// 默认的管理员ID 2
        /// </summary>
        public static long DefaultWeighingManagerId = 2;


        public readonly static string BarCodeName = "BarCodeUc";
        public readonly static string QrCodeName = "QrCodeUc";
        public readonly static string StaticTextNamePre = "staticText";

        
        /// <summary>
        /// 自动日志保存的路径
        /// </summary>
        public static string UnnanedLogPath = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "unmanned");

        /// <summary>
        /// 无人值守临时日志
        /// </summary>
        public static string TempUnmanLogFileName = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),"temp_log.txt");
        /// <summary>
        ///  Same Plate Default Interval Seconds  ,5 * 60 s;
        /// </summary>
        public static int SamePlateIntervalSecondsDefault = 5 * 60 ;

        public static string RestartAppFile = System.IO.Path.Combine(MyHelper.FileHelper.GetRunTimeRootPath(), "Restart.exe");
        /// <summary>
        /// reports once search max rows. default 5000
        /// </summary>
        public static int ReportMaxRows = 5000;

        internal static string columnsSettingFile = System.IO.Path.Combine(dataPath, "columns.json");

        /// <summary>
        /// 备用字段名称
        /// </summary>
        public static class BackfieldName
        {
            public static string BackString1 = "backup_string1";
            public static string BackString2 = "backup_string2";
            public static string BackString3 = "backup_string3";
            public static string BackString4 = "backup_string4";
            public static string BackString5 = "backup_string5";

            public static string BackInt1 = "backup_int1";
            public static string BackInt2 = "backup_int2";
            public static string BackInt3 = "backup_int3";
            public static string BackInt4 = "backup_int4";
            public static string BackInt5 = "backup_int5";


            public static string BackDecimal1 = "backup_decimal1";
            public static string BackDecimal2 = "backup_decimal2";
            public static string BackDecimal3 = "backup_decimal3";
            public static string BackDecimal4 = "backup_decimal4";
            public static string BackDecimal5 = "backup_decimal5";
        }


        public static string[] relpaceAssemblys = new string[] { "assembly=ManagerCenter", "assembly=bnweighing" };
        public static string currAssembly = "assembly=weighing";
    }
}
